<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>订单</title>
    <style>
        h2 {
            text-align: center;
        }

        table {
            border-collapse: collapse;
            height: 80px;
            margin: 0 auto;
            text-align: center;
        }

        th {
            padding: 5px 30px;
        }

        table,
        th,
        td {
            border: 1px solid #000;
        }
    </style>
</head>

<body>
    <h2>订单</h2>

    <script>
        let name=prompt('请输入商品名字')
        let price = +prompt('请输入商品价格：')
        let num = +prompt('商品数量：')
        let address = prompt('收货地址：')
        let total = price * num
        document.write(`
    <table>
        <tr>
            <th>名称</th>
            <th>价格</th>
            <th>数量</th>
            <th>总价</th>
            <th>地址</th>
        </tr>
    
    <tr>
        <th>${name}</th>
        <th>${price}</th>
         <th>${num}</th>
    <th>${total}</th>
        <th>${address}</th>


    </tr>
</table>

    `)


    </script>
</body>

</html>